home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / dsp / 96000tar.z / 96000tar / 96000 / appb / b140b.asm < prev    next >
Assembly Source File  |  1992-04-28  |  3KB  |  50 lines

  1. ; This program was originally published in the Motorola DSP96002 Users Manual
  2. ; and is provided under a DISCLAIMER OF WARRANTY available from Motorola DSP
  3. ; Operation, 6501 William Cannon Drive West, Austin, Texas 78735-8598.  For
  4. ; more information, refer to the DSP96002 Users Manual, Appendix B, DSP
  5. ; Benchmarks.
  6. ;
  7. ; B.1.40.2    64 Bit Block Transfer  
  8. ;A more efficient implementation of BITBLT may be performed by  transferring 64 bits at a time.  Thus, 
  9. ;the value of COUNT specifies  the number of 64 bit transfers (two 32 bit words).  
  10. ;              64 Bit Block Transfer                         Program    ICycles 
  11. ;                     BITBLT                                 Words 
  12.        org   x:0 
  13. source ds      1      ;source address 
  14. dest   ds      1      ;destination address 
  15. offset ds      1      ;bit number start (0-31) 
  16. count  ds      1      ;number of 64 bit source words 
  17.  
  18.   org  p:$50 
  19.   move          x:offset,d0.l ;get output bit position         2     2 
  20.   move          x:offset,d0.l ;get output bit position         2     2 
  21.   move          #32,d1.l      ;get 32                          2     2 
  22.   sub   d0,d1   x:source,r0   ;32-offset, get source address   2     2 
  23.   move          x:dest,r1     ;point to destination address    2     2 
  24.   move          d1.l,d1.h     ;move shift factor               1     1 
  25.   lsl   d1,d4   d0.l,d0.h     ;shift bits, move shift factor   1     1 
  26.   move          x:count,n0    ;get source word count           2     2 
  27.   move          (r1)-         ;backup pointer                  1     1 
  28.   move          y:(r1)+,d6.l  ;init pipe                       1     1 
  29.   move          y:(r1)-,d4.l  ;get first bits of dest          1     1 
  30.   move          y:(r0)+,d5.l  ;get source bits                 1     1 
  31.   do    n0,bitblt             ;do transfer                     2     3 
  32.   lsr   d1,d4   d6.l,y:(r1)+                                   1     1 
  33.   lsl   d0,d5   d5.l,d3.l                                      1     1 
  34.   or    d4,d5   y:(r0)+,d6.l                                   1     1 
  35.   lsr   d1,d3   d5.l,y:(r1)+                                   1     1 
  36.   lsl   d0,d6   d6.l,d4.l                                      1     1 
  37.   or    d3,d6   y:(r0)+,d5.l                                   1     1 
  38. bitblt 
  39.   move          d6.l,y:(r1)+                                   1     1 
  40.   lsr   d1,d4   y:(r1),d5.l   ;shift old bits, get dest bits   1     1 
  41.   lsr   d0,d5                 ;shift dest bits                 1     1 
  42.   lsl   d0,d5                 ;shift dest bits back            1     1 
  43.   or    d4,d5                 ;part of dest with source bits   1     1 
  44.   move          d5.l,y:(r1)   ;save new destination bits       1     1 
  45.                                                        ;       ---   --- 
  46.                                                      ; Totals:  32  6N+27 
  47.  
  48. ;Where N represents 64 bits transferred.  At a 13.5 MIPS, a total of  (13.5/6)*64 = 144 
  49. ;MBits/Second transfer rate is possible.  
  50.